home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / utils1 / hdnfojt.arj / HDINFO.H < prev    next >
C/C++ Source or Header  |  1993-11-23  |  2KB  |  81 lines

  1. // read/write data registers
  2. #define HDC_DATA    0x1F0
  3. #define HDC_ERROR   0x1F1
  4. #define HDC_SECCOU  0x1F2
  5. #define HDC_SECNUM  0x1F3
  6. #define HDC_CYLLOW  0x1F4
  7. #define HDC_CYLHIGH 0x1F5
  8. #define HDC_SDH     0x1F6
  9.  
  10. // read ports
  11. #define HDC_STATUS  0x1F7
  12. #define HDC_ALTSTA  0x3F6
  13.  
  14. // write ports
  15. #define HDC_COMMAND 0x1F7
  16. #define HDC_FIXED   0x3F6
  17.  
  18. // read/write commands
  19. #define HDC_COMMAND_RESTORE 0x10
  20. #define HDC_COMMAND_SEEK    0x70
  21. #define HDC_COMMAND_READ    0x20
  22. #define HDC_COMMAND_WRITE   0x30
  23. #define HDC_COMMAND_FORMAT  0x50
  24. #define HDC_COMMAND_READVER 0x90
  25. #define HDC_COMMAND_DIAG    0x90
  26. #define HDC_COMMAND_SETPAR  0x91
  27. #define HDC_COMMAND_WRSTACK 0xE8
  28. #define HDC_COMMAND_RDSTACK 0xE4
  29. #define HDC_COMMAND_READPAR 0xEC
  30. #define HDC_COMMAND_POWER   0xE0
  31.  
  32. // irqs
  33. #define HDC_FIXED_IRQ        0x02
  34. #define HDC_FIXED_RESET     0x04
  35.  
  36. // drive status flags
  37. #define HDC_STATUS_ERROR    0x01
  38. #define HDC_STATUS_INDEX    0x02
  39. #define HDC_STATUS_ECC        0x04
  40. #define HDC_STATUS_DRQ        0x08
  41. #define HDC_STATUS_COMPLETE 0x10
  42. #define HDC_STATUS_WRFAULT  0x20
  43. #define HDC_STATUS_READY    0x40
  44. #define HDC_STATUS_BUSY     0x80
  45.  
  46. const int DRIVE_0 = 0;
  47. const int DRIVE_1 = 1;
  48.  
  49. struct ideinfo {
  50.      unsigned genconf,    // drive id
  51.           fixcyls,            // number of cylinders
  52.           remcyls,            // number of removable cylinders
  53.           heads,                // number of heads
  54.           bytetrack,         // bytes per track
  55.           bytesector,        // bytes per sector
  56.           sectors,           // sectors per track
  57.           bytegap,           // bytes intesector gap
  58.           bytesync,          // bytes in sync
  59.           wordunique;        // words unique status
  60.      char serial[20];        // serial number
  61.      unsigned contype,   // controller type
  62.           bufsiz,            // buffer size in 512 byte blocks
  63.           byteecc;           // ECC bytes transferred in read/write long
  64.      char firmware[8],   // firmware revision
  65.      model[40];             // model ID
  66.      unsigned secsint,   // number of sectors transferred per interrupt
  67.           dblword,           // double word transfer flag
  68.           writepro;          // write protect
  69.      double capacity;        // capacity of drive in Mb
  70.  
  71.                                 // EXTENTION TO NORMAL DATA STRUCTURE
  72.      unsigned bestcyls,    // calculated best cylinders
  73.           bestheads,        // calculated best heads
  74.           bestsecs;            // calculated best sectors
  75.      double bioscapacity;
  76.      unsigned bioscyls,
  77.           biosheads,
  78.           biossecs;
  79.     };
  80.  
  81.